<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js"><span id='global-property-'>/**
</span> * @fileOverview 可以展开折叠的控件
 * @ignore
 */


<span id='BUI-Component-UIBase-CollapsableView'>/**
</span> * 控件展开折叠的视图类
 * @class BUI.Component.UIBase.CollapsableView
 * @private
 */
var collapsableView = function() {

};

collapsableView.ATTRS = {
  collapsed: {}
}

collapsableView.prototype = {
  //设置收缩样式
  _uiSetCollapsed: function(v) {
    var _self = this,
      cls = _self.getStatusCls(&#39;collapsed&#39;),
      el = _self.get(&#39;el&#39;);
    if (v) {
      el.addClass(cls);
    } else {
      el.removeClass(cls);
    }
  }
}
<span id='BUI-Component-UIBase-Collapsable'>/**
</span> * 控件展开折叠的扩展
 * @class BUI.Component.UIBase.Collapsable
 */
var collapsable = function() {

};

collapsable.ATTRS = {
<span id='BUI-Component-UIBase-Collapsable-property-collapsable'>  /**
</span>   * 是否可折叠
   * @type {Boolean}
   */
  collapsable: {
    value: false
  },
<span id='BUI-Component-UIBase-Collapsable-cfg-collapsed'>  /**
</span>   * 是否已经折叠 collapsed
   * @cfg {Boolean} collapsed
   */
<span id='BUI-Component-UIBase-Collapsable-property-collapsed'>  /**
</span>   * 是否已经折叠
   * @type {Boolean}
   */
  collapsed: {
    view: true,
    value: false
  },
  events: {
    value: {
<span id='BUI-Component-UIBase-Collapsable-event-expanded'>      /**
</span>       * 控件展开
       * @event
       * @param {Object} e 事件对象
       * @param {BUI.Component.Controller} target 控件
       */
      &#39;expanded&#39;: true,
<span id='BUI-Component-UIBase-Collapsable-event-collapsed'>      /**
</span>       * 控件折叠
       * @event
       * @param {Object} e 事件对象
       * @param {BUI.Component.Controller} target 控件
       */
      &#39;collapsed&#39;: true
    }
  }
};

collapsable.prototype = {
  _uiSetCollapsed: function(v) {
    var _self = this;
    if (v) {
      _self.fire(&#39;collapsed&#39;);
    } else {
      _self.fire(&#39;expanded&#39;);
    }
  }
};

collapsable.View = collapsableView;

module.exports = collapsable;
</pre>
</body>
</html>
